package xmluserdata;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class UserDataBuilder
{
  public static final String [] USER_PROFILE_NODES =
  {
  "email",
  "firstName",
  "lastName",
  "division",
  "department",
  "title",
  "scope",
  "zoneCode",
  "studentId"
  };
  
   public static final String[] DEALER_PROFILE_NODES = 
  {
  "dealerCode",
  "dealerName",
  "zoneCode",
  "division",
  "dealerAddress",
  "hiSpeed"
  };
  
  static synchronized  UserData setUserProfile(UserData ud, NodeList list) throws Exception
  {
    for (int i = 0; i < list.getLength(); i++)
    {
      Node n = (Node) list.item(i);
      System.out.println("" + n.getNodeName());
      for(int x=0;x<USER_PROFILE_NODES.length;x++)
      {
        if(USER_PROFILE_NODES[x].equals( n.getNodeName()))
        {
          System.out.println("detected a match at " + n.getNodeName());
        }
      }
    }
    return ud;
  }
  
}